<!DOCTYPE HTML>
<html>
<head>
    <title>用户列表</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/laypage.css">
    <link rel="stylesheet" href="/js/layer/skin/default/layer.css"/>
</head>
<body>

<div class="container">
    <!-- 标题 -->
    <div class="row">
        <div class="col-md-12">
            <h1>收藏试题</h1>
        </div>
    </div>
    <!-- 按钮 -->
  <#--  <div class="row">
        <div class="col-md-4 col-md-offset-8">
            <a class="btn btn-primary" href="${path}/user/toAddUser">新增</a>
        </div>
    </div>-->
    <!-- 表格  -->
    <div class="row">
        <div class="col-md-12">
            <table class="table table-hover">
                <tr>
                    <th>id</th>
                    <th>题目</th>
                    <th>备注</th>
                    <th>时间</th>
                </tr>
                <#list list as coll><tr>
                    <td>${coll.coll_id}</td>
                    <td>${coll.problem.pro_name}</td>
                    <td>${coll.coll_remark }</td>
                    <td>${(coll.f_date?string("yyyy-MM-dd"))!} </td>
                    <!-- <td><a  class="edit">编辑</a> <a
                         class="delete">删除</a></td> -->
                    <td>
                        <a   href="${path}/coll/updateColl.do?id=${coll.coll_id}" class="btn btn-info btn-sm">
                            <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                            编辑</a>
                        <a  id="delete" href="javascript:deleteColl(${coll.coll_id})" class="btn btn-danger btn-sm">
                            <span class="glyphicon glyphicon-trash" aria-hidden="true" ></span>
                            删除</a>
                    </td>
                </tr>
                </#list>
            </table>
        </div>
    </div>


    <hr style="height:1px;border:none;border-top:1px solid #ccc;" />
    <!-- 分页导航栏 -->

    <!-- 分页信息 -->
    <div class="row">
        <!-- 分页文字信息，其中分页信息都封装在pageInfo中 -->
        <div class="col-md-6">
            当前第：${pageInfo.pageNum}页，总共：${pageInfo.pages}页，总共：${pageInfo.total}条记录
        </div>

        <!-- 分页条 -->
        <div class="col-md-6">
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li><a href="${path}/coll/collInfo?pn=1">首页</a></li>
                    <c:if test="${pageInfo.hasPreviousPage }">
                        <li>
                            <a href="${path}/coll/collInfo?pn=${pageInfo.pageNum-1}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                    </c:if>
                    <#list list as coll>

                        <c:if test="${page_Num == pageInfo.pageNum }">
                            <li class="active"><a href="#">${ page_Num}</a></li>
                        </c:if>
                        <c:if test="${page_Num != pageInfo.pageNum }">
                            <li><a href="${path}/coll/collInfo?pn=${ page_Num}">${ page_Num}</a></li>
                        </c:if>

                    </#list>

                    <c:if test="${pageInfo.hasNextPage }">
                        <li>
                            <a href="${path}/coll/collInfo?pn=${pageInfo.pageNum+1}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </c:if>
                    <li><a href="${path}/coll/collInfo?pn=${pageInfo.pages}">末页</a></li>
                </ul>
            </nav>
        </div>
    </div>
</div>
<script src="/js/vue/vue.min.js"></script>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="/js/jquery/jquery.min.js"></script>
<script src="/js/laypage/laypage.js"></script>
<script src="/js/layer/layer.js"></script>
<script src="http://code.jquery.com/jquery-1.10.2.min.map"></script>
<script>
    function deleteColl(obj){

        layer.confirm('确定删除？', {
                    btn: ['是', '否']
                }, function () {    //如果点击了第一个按钮 ——是
                    window.location.href="/coll/delete.do?id="+obj
                },function(){}
        )
    }

   //默认prompt
   layer.prompt({title: '请输入修改内容:', formType: 2}, function(text, index){

       $.ajax({
           type: "GET",
           dataType:'json',
           url: "/coll/updateColl.do?id="${coll.coll_id}

       });
       layer.close(index);
   });






</script>

</body>
</html>